package ynu.edu.controller;


import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import ynu.edu.common.controller.LogicController;
import ynu.edu.dao.UserDao;
import ynu.edu.entity.User;
import ynu.edu.service.UserService;

@Api(tags = "用户实体的控制器")
@RestController
@RequestMapping("/user")
public class UserController extends LogicController<UserService, UserDao, User,Long> {
    public UserController(@Autowired UserService service){
        super(service);
    }
    @PostMapping("/login")
    public User login(@RequestParam("name")String name,@RequestParam("password")String password){
        return getService().login(name,password);
    }
}
